<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a>续期列表</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Examine/xu_list')}" style='line-height: 46px;'>
			订单号： 
			<input type="text" name="order_id" style="width: 200px;" value="{:I('request.order_id')}" placeholder="请输入订单号">
			姓名： 
			<input type="text" name="name" style="width: 200px;" value="{:I('request.name')}" placeholder="姓名">
			申请时间：<input class="js-date" type="text" name="starts" style="width: 200px;" value="{:I('request.starts')}" placeholder="起始时间">
			<input class="js-date" type="text" name="ends" style="width: 200px;" value="{:I('request.ends')}" placeholder="结束时间"><br />
			状态：<select name="status">
				<php>$tpl_selected=I('request.status')==''?"selected":"";</php>
				<option {$tpl_selected} value="">全部</option>
				<php>$tpl_selected=I('request.status')=='0'?"selected":"";</php>
				<option {$tpl_selected} value="0">待审核</option>
				<php>$tpl_selected=I('request.status')=='1'?"selected":"";</php>
				<option {$tpl_selected} value="1">审核成功</option>
				<php>$tpl_selected=I('request.status')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">审核失败</option>
			</select>
			是否成人：<select name="is_adult">
				<php>$tpl_selected=I('request.is_adult')==''?"selected":"";</php>
				<option {$tpl_selected} value="">全部</option>
				<php>$tpl_selected=I('request.is_adult')=='1'?"selected":"";</php>
				<option {$tpl_selected} value="1">成人</option>
				<php>$tpl_selected=I('request.is_adult')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">学生</option>
				<php>$tpl_selected=I('request.is_adult')=='3'?"selected":"";</php>
				<option {$tpl_selected} value="3">未知</option>
			</select>
			财务： 
			<input type="text" name="caiwu" style="width: 200px;" value="{:I('request.caiwu')}" placeholder="财务">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:U('Examine/xu_list')}">清空</a>
		</form>
		<form method="post" class="js-ajax-form">
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th  align="center">订单号</th>
						<th>用户名</th>
						<th>身份证号码</th>
						<th>续期金额</th>
						<th>申请时间</th>
						<th>审核人</th>
						<th>申请完结时间</th>
						<th>财务</th>
						<th>是否成人</th>
						<th>状态</th>
						<th align="center">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="list" item="vo">
					<tr>
						<td align="center">{$vo.order_id}</td>
						<td>{$vo.name}</td>
						<td>{$vo.identity}</td>
						<td>{$vo.amount}</td>
						<td>{$vo.crtime}</td>
						<td>{$users[$vo['lastuser_id']]|default='系统'}</td>
						<td>{$vo.endtime}</td>
						<td>{$vo['loan_user']|default=''}</td>
						<td>
						<if condition="$vo['is_adult'] eq 1">成人
						<elseif condition="$vo['is_adult'] eq 2"/>学生
						<else />未知
						</if>
						</td>
						<td>{$vo['status']==1?'成功':($vo['status']==2?'失败':'待审核')}</td>
						<td align="center">
							<if condition="($vo['status']==0)">
								<a href="{:U('Examine/xu_info',array('id'=>$vo['id']))}">审核续期</a>
							</if>
						</td>
					</tr>
					</foreach>
				</tbody>
				<tfoot>
				<tr>
					<td>当页合计：</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
				</tr>
				<tr>
					<td>总计：</td>
					<td></td>
					<td></td>
					<td>{$total_amount}</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
				</tr>
				</tfoot>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
        $(function () {
            var arr = [3];//要取哪几列的合计
            var def = 'var ';
            for(var a in arr){
                def += ('total'+arr[a]+'=0,');
            }
            def=def.substring(0,def.length-1)+';';
            eval(def);//执行定义
            $('tbody tr').each(function() {
                for(var i in arr){
                    $(this).find('td:eq('+arr[i]+')').each(function(){
                        var tmp = $(this).text();
                        if(tmp === ''){
                            tmp = 0;
                        }
                        eval('total'+arr[i]+'+=parseFloat(tmp);');
                    });
                }
            });
            for(var x in arr){
                $('tfoot tr:eq(0)').find('td:eq('+arr[x]+')').text(eval('total'+arr[x]));
            }
        });
	</script>
</body>
</html>